package com.gg.registration.model.user;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.gg.registration.model.base.BaseEntity;
import lombok.Data;

import java.util.Objects;

/**
 * <p>
 * UserInfo
 * </p>
 *
 * @author qy
 */
@Data
@TableName("user_info")
public class UserInfo extends BaseEntity {
	
	private static final long serialVersionUID = 1L;
	
	@TableField("openid")
	private String openid;

	@TableField("nick_name")
	private String nickName;

	@TableField("phone")
	private String phone;

	@TableField("name")
	private String name;

	@TableField("certificates_type")
	private String certificatesType;

	@TableField("certificates_no")
	private String certificatesNo;

	@TableField("certificates_url")
	private String certificatesUrl;

	/**
	 * 认证状态 ： 0：未认证  1：认证中  2：认证成功  3：认证失败
	 */
	@TableField("auth_status")
	private Integer authStatus;

	/**
	 * 状态 ：  0：锁定  1：正常
	 */
	@TableField("status")
	private Integer status;


	public String getOpenid() {
		return openid;
	}

	public void setOpenid(String openid) {
		this.openid = openid;
	}

	public String getNickName() {
		return nickName;
	}

	public void setNickName(String nickName) {
		this.nickName = nickName;
	}

	public String getPhone() {
		return phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getCertificatesType() {
		return certificatesType;
	}

	public void setCertificatesType(String certificatesType) {
		this.certificatesType = certificatesType;
	}

	public String getCertificatesNo() {
		return certificatesNo;
	}

	public void setCertificatesNo(String certificatesNo) {
		this.certificatesNo = certificatesNo;
	}

	public String getCertificatesUrl() {
		return certificatesUrl;
	}

	public void setCertificatesUrl(String certificatesUrl) {
		this.certificatesUrl = certificatesUrl;
	}

	public Integer getAuthStatus() {
		return authStatus;
	}

	public void setAuthStatus(Integer authStatus) {
		this.authStatus = authStatus;
	}

	public Integer getStatus() {
		return status;
	}

	public void setStatus(Integer status) {
		this.status = status;
	}

	@Override
	public String toString() {
		return "UserInfo{" +
				"openid='" + openid + '\'' +
				", nickName='" + nickName + '\'' +
				", phone='" + phone + '\'' +
				", name='" + name + '\'' +
				", certificatesType='" + certificatesType + '\'' +
				", certificatesNo='" + certificatesNo + '\'' +
				", certificatesUrl='" + certificatesUrl + '\'' +
				", authStatus=" + authStatus +
				", status=" + status +
				'}';
	}

	@Override
	public boolean equals(Object o) {
		if (this == o) return true;
		if (o == null || getClass() != o.getClass()) return false;
		UserInfo userInfo = (UserInfo) o;
		return Objects.equals(openid, userInfo.openid) &&
				Objects.equals(nickName, userInfo.nickName) &&
				Objects.equals(phone, userInfo.phone) &&
				Objects.equals(name, userInfo.name) &&
				Objects.equals(certificatesType, userInfo.certificatesType) &&
				Objects.equals(certificatesNo, userInfo.certificatesNo) &&
				Objects.equals(certificatesUrl, userInfo.certificatesUrl) &&
				Objects.equals(authStatus, userInfo.authStatus) &&
				Objects.equals(status, userInfo.status);
	}

	@Override
	public int hashCode() {
		return Objects.hash(openid, nickName, phone, name, certificatesType, certificatesNo, certificatesUrl, authStatus, status);
	}
}

